package org.linloong.modules.apis.monitor.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
@TableName("t_insect_data")
@Schema(name = "InsectData", description = "虫情灯数据实体（对应文档\"虫情灯数据接口\"章节Response）")
public class InsectData {
    @TableId(type = IdType.ASSIGN_UUID)
    @Schema(description = "自定义主键（UUID）", example = "123e4567-e89b-12d3-a456-426614174007")
    private String id;

    @Schema(description = "文档中返回的\"id\"字段（无实际意义，备用）", example = "1006")
    private String apiId;

    @Schema(description = "设备ID（仅虫情灯设备）", example = "ZW101569")
    private String deviceId;

    @Schema(description = "数据时间戳（文档中\"timestamp\"字段，Unix毫秒级）", example = "1592271960000")
    private Long timestamp;

    @Schema(description = "虫情灯图片路径（文档中\"image\"字段）", example = "https://oss.example.com/insect/1.jpg")
    private String image;

    @TableField(typeHandler = JacksonTypeHandler.class)
    @Schema(description = "虫子识别位置（文档中\"position\"字段，JSON格式）", example = "{\"x\":100,\"y\":200,\"width\":50,\"height\":50}")
    private Object position;

    @Schema(description = "图片认证状态（文档中\"certified\"字段，true=已认证，false=未认证）", example = "true")
    private Boolean certified;
}